/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package reyes.mysite.jdo;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

/**
 *
 * @author reyesyang
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Category {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long id;
    @Persistent
    private String name;
    @Persistent
    private String nickName;

    public Category(String name){
        this.name =  name;
        this.nickName = name.replace(" ", "-");
    }

    public Long getId(){
        return this.id;
    }

    public void setName(String name) {
        this.name  = name;
    }

    public String getName(){
        return this.name;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getNickName() {
        return this.nickName;
    }
}
